<template>
    <van-row>
        <van-col span="12" v-for="item, index in list"  :key="index" @click="push({ name: 'info', query: { id: item.wares_id } })">
          <van-image :src="Array.isArray(item.wares_masterimg)?item.wares_masterimg[1]:item.wares_masterimg"></van-image>
          <div class="title">{{ item.wares_title }}</div>
          <div v-if="boor" class="pice">{{ item.wares_oldprice }}</div>
        </van-col>
    </van-row>
</template>

<script lang="ts" setup>
import { useRouterAction } from "@/utils/router";
const { push } = useRouterAction()
import { IndexType,ClassType } from "@/types/res/home";

withDefaults(defineProps<{
    list: ClassType[] | IndexType[],
    boor:boolean
}>(), {
    list: () => [],
    boor:true // trun 显示 false 隐藏 默认为true
})

</script>

<style lang="less" scoped>
.van-col {
    margin-top: 15px;
}
.title {
    font-size: 0.37333rem;
    color: #000;
    font-weight: 600;
    text-align: center;
}
.pice {
    color: #ea625b;
    font-size: 0.37333rem;
    margin-top: 0.13333rem;
    text-align: center;
}
</style>